package com.chenqing.baike;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class spider {
    @Test
    void socket(){
        Socket socket = null;
        String Code_Adress = "localhost";
        try {
            socket = new Socket(Code_Adress,9007);
            OutputStream outputStream = socket.getOutputStream();
            outputStream.write("金州勇士".getBytes());
            socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
